package com.homework.ch0123;
import java.util.Scanner;
public class JudgeMonth {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int month=0;
        do{
            System.out.print("请输入月份：");
            month=sc.nextInt();
            switch(month)
            {
                case 12:
                case 1:
                case 2:
                    System.out.println(month+"月属于冬季");
                    break;
                case 3:
                case 4:
                case 5:
                    System.out.println(month+"月属于春季");
                    break;
                case 6:
                case 7:
                case 8:
                    System.out.println(month+"月属于夏季");
                    break;
                case 9:
                case 10:
                case 11:
                    System.out.println(month+"月属于秋季");
                    break;
                default:
                    System.out.println("输入月份错误，请重新输入！");
            }
        }while(month<1||month>12);


    }
}
